package com.zy.business.domain;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.zy.common.annotation.Dict;
import com.zy.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.util.Date;

/**
 * @Description
 * @Author  zhangxiaojia
 * @Date 2020-11-05
 */
@Data
@EqualsAndHashCode
@ApiModel
@TableName("tb_absence" )
public class TbAbsence extends BaseEntity {

	/**
	 * 主键
	 */
   	 @TableId(value = "absence_id")
	 @ApiModelProperty(hidden = true)
	private Long absenceId;

	/**
	 * 申请人id
	 */
   	 @TableField("apply_id" )
	 @ApiModelProperty(value ="申请人id",required = false)
	private Long applyId;

	/**
	 * 请假类型
	 */
   	 @TableField("type" )
	 @Dict(dictDataSource = "absence_type")
	 @ApiModelProperty(value ="请假类型(数据字典)")
	private String type;

	@TableField(exist = false )
	private String typeName;

	/**
	 * 开始时间
	 */
   	 @TableField("start_time" )
	 @ApiModelProperty(value ="开始时间",required = true)
	 @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
	private Date startTime;

	/**
	 * 结束时间
	 */
   	 @TableField("end_time" )
	 @ApiModelProperty(value ="结束时间",required = true)
	 @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
	private Date endTime;

	/**
	 * 请假时长
	 */
   	 @TableField("absence_duration" )
	 @ApiModelProperty(value ="请假时长",required = true)
	private Double absenceDuration=0d;

	/**
	 * 调休时长
	 */
	@TableField("SABBATICAL_HOUR" )
	@ApiModelProperty(value ="调休时长",required = true)
	private Double sabbaticalHour;

	/**
	 * 请假事由
	 */
   	 @TableField("reason" )
	 @ApiModelProperty(value ="请假事由",required = true)
	private String reason;

	/**
	 * 审批人id
	 */
	@TableField("approve_id" )
	@ApiModelProperty(value ="审批人id")
	private Long approveId;

	/**
	 * 审批人名字
	 */
	@TableField(exist = false)
	@ApiModelProperty(hidden = true)
	private String approveUser;


	/**
	 * 抄送人ids
	 */
	@TableField("copy_ids" )
	@ApiModelProperty(value ="抄送人ids")
	private String copyIds;

	/**
	 * 抄送人names
	 */
	@TableField(exist = false)
	@ApiModelProperty(hidden = true)
	private String copyNames;

	/**
	 * 状态（1.待审批2.同意3.拒绝）
	 */
	@TableField("state" )
	@ApiModelProperty(hidden = true)
	private Integer state;

	/**
	 * 删除标志0未删除1已删除
	 */
	@TableLogic
	@TableField(value = "del_flag")
	@ApiModelProperty(hidden = true)
	private String delFlag;

	/**
	 * 实际请假
	 */
	@TableField("actual_absence" )
	private Double actualAbsence;

	/**
	 * 实际调休
	 */
	@TableField("actual_sabbatical" )
	private Double actualSabbatical;

	@TableField(exist = false)
	private Integer isEdit;

}
